<template>
  <div class="listage" v-if="listdata">
    <div class="head">
      <router-link tag="span" to="/category"> <img src="../assets/img/fhui.png" alt="" /></router-link>
      <h1>商品列表</h1>
    </div>
   <div class="middle">
     <router-link tag="div" :to="'/item?id='+1" class="content" v-for="(item,index) in listdata" :key='index' >
      <div class="left">
        <img
          :src="item.imgurl"
          alt=""
        />
      </div>
      <div class="right">
        <h5>{{item.name}}</h5>
        <p>{{item.Description}}</p>
        <span>&yen;{{item.price}}</span>
      </div>
    </router-link>
   </div>
  </div>
</template>

<script>
 
export default {
  props:['listdata']
};
</script>

<style lang="scss" scoped>
.listage {
    width: 100%;
  .head {
    height: 50px;
    display: flex;
    border-bottom: 1px solid #dfdede;
    position: fixed;
    top: 0px;
    left: 0px;
    right: 0px;
    z-index: 5;
    background-color: #fff;
    span {
      display: block;
      width: 20px;
      height: 20px;
      margin: 15px 20px;
      img {
        width: 20px;
      }
    }
    h1 {
      font-size: 18px;
      line-height: 50px;
      flex: 1;
      text-align: center;
      padding-right: 15%;
      color: rgba(0, 0, 0, 0.6);
      font-weight: 700;
    }
  }
  .middle{
    margin-top: 50px;
    .content {
    width: 95%;
    height: 162px;
    
    background-color: #fff;
    display: flex;
    justify-content: flex-start;
    border-bottom: 1px solid #dfdede;
   
    .left {
      width: 48%;
      img {
        display: block;
        margin: 12% 0%;
        width: 126px;
        height: 126px;
      }
    }
    .right {
      width: 50%;
     display: flex;
     flex-direction: column;
     justify-content: center;
      
     
      h5{
      
        overflow: hidden;
        white-space: nowrap;
         text-overflow: ellipsis;
         color: #333;
         font-weight: 700;
         padding-bottom: 8px;
      }
      p{
         overflow: hidden;
        white-space: nowrap;
         text-overflow: ellipsis;
         font-size: 12px;
         color: #7f7f7f;
          padding-bottom: 30px;
      }
      span{
        color: #d44d44;
        font-weight: 700;
        font-size: 14px;
      }
    }
  }
  }
}
</style>